Skip to content

Adds a check if OpenTelemetry instrumentation can be used.#4486

Merged
pmaytak merged 4 commits intopmaytak/azfunc-ds-6from
pmaytak/azfunc-otel-catch
Jan 9, 2024
Merged

Adds a check if OpenTelemetry instrumentation can be used.#4486
pmaytak merged 4 commits intopmaytak/azfunc-ds-6from
pmaytak/azfunc-otel-catch

Conversation

@pmaytak
Copy link
Copy Markdown
Contributor

@pmaytak pmaytak commented Jan 4, 2024

Fixes #4456. An alternative to #4487 solution.

Changes proposed in this request
Catching error when instantiating Open Telemetry fails (means it's not available in that environment) and using null telemetry implementation instead.

Testing
Manual.

This solution seems to be better than #4487, since there may be a need to bump DiagnosticsSource version if we need to use the newer APIs.

@pmaytak pmaytak changed the title Adds a check if OTel can be used. Adds a check if OpenTelemetry instrumentation can be used. Jan 4, 2024
Copy link
Copy Markdown
Contributor

@neha-bhargava neha-bhargava left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would recommend using this solution rather than #4487 since the problem will still occur in case anyone uses otel exporter version >=1.4 and the workarounds for the versions will still be needed.

@pmaytak
Copy link
Copy Markdown
Contributor Author

pmaytak commented Jan 8, 2024

I would recommend using this solution rather than #4487 since the problem will still occur in case anyone uses otel exporter version >=1.4 and the workarounds for the versions will still be needed.

I'll combine the two PRs actually. Yes, if client app uses OpenTelemetry 1.4+, that'll still break but it won't be because of MSAL. The main issue here is client apps that don't use any telemetry should work and not break because of MSAL.

@pmaytak pmaytak changed the base branch from main to pmaytak/azfunc-ds-6 January 9, 2024 02:46
@pmaytak pmaytak merged commit 153757f into pmaytak/azfunc-ds-6 Jan 9, 2024
@pmaytak pmaytak deleted the pmaytak/azfunc-otel-catch branch January 9, 2024 02:51
pmaytak added a commit that referenced this pull request Jan 10, 2024
…f OpenTelemetry instrumentation can be used (#4487)

* Downgrade System.Diagnostics.DiagnosticSource to v6.

* Adds a check if OpenTelemetry instrumentation can be used. (#4486)

* Adds a check if OTel can be used.

* Comments. More specific error type.

* Add comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Dependency on System.Diagnostics.DiagnosticSource (>= 7.0.2) in version 4.58.0 missing in .NET 6 Azure Functions

4 participants